package com.idata.model.response;

import cn.hutool.core.collection.ListUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class DisputeWordResponse implements Serializable, Comparable<DisputeWordResponse> {
    private String name;
    private int count;

    @Override
    public int compareTo(DisputeWordResponse otherResponse) {
        return Integer.compare(otherResponse.getCount(), this.count);
    }

    public static List<DisputeWordResponse> mock() {
        return ListUtil.toList(new DisputeWordResponse("打人", 5),
                new DisputeWordResponse("抢劫", 7),
                new DisputeWordResponse("放火", 2),
                new DisputeWordResponse("家暴", 2),
                new DisputeWordResponse("偷东西", 3),
                new DisputeWordResponse("拖欠工资", 1));
    }
}